<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img src="img/a.jpg" id="img1">
<button onclick="change()">按钮</button>
<script type="text/javascript">
    var img1 = document.getElementById("img1");
function change() {
    img1.height=100
    img1.width=100
}
</script>
</body>
</html>